package cn.denny.designpattern.strategy;

public class PriceManager {
	public final static int STRATEGY_1 = 0;
	public final static int STRATEGY_2 = 1;
	public final static int STRATEGY_3 = 2;

	private Strategy strategy;

	public PriceManager() {
	}

	public double priceRebate(double price, int rebate) {
		
		switch (rebate) {
		case STRATEGY_1:
			strategy = new Strategy1();
			price = strategy.rebate(price);
			break;
		case STRATEGY_2:
			strategy = new Strategy2();
			price = strategy.rebate(price);
			break;
		case STRATEGY_3:
			strategy = new Strategy3();
			price = strategy.rebate(price);
			break;
		}
		return price;
	}
}
